﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;

namespace WPFDevelopers.Samples
{
    public partial class CustomHandleStyleByWind : ResourceDictionary
    {

        #region 定义单例模式

        public Window window { get; set; }
        private static CustomHandleStyleByWind instance = null;
        public CustomHandleStyleByWind() { }
        public static CustomHandleStyleByWind Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new CustomHandleStyleByWind();
                }
                return instance;
            }
        }

        #endregion


        #region 窗口事件
        public void Close_Click(object sender, RoutedEventArgs e)
        {
            if (instance.window == null)
                return;
            instance.window.Close();
        }

        public void Maximize_Click(object sender, RoutedEventArgs e)
        {
            if (instance.window == null)
                return;
        }

        public void Minimize_Click(object sender, RoutedEventArgs e)
        {
            if (instance.window == null)
                return;
        }

        private void Windos_Droup(object sender, MouseButtonEventArgs e)
        {
            //if (instance.window == null)
            //    return;
            //instance.window.DragMove();

        }

        #endregion
    }
}
